[#include "/app/common/layout/__backstagemainlayout.html"/]
[@mainlayout pageJavascript=pageJavascript pageCss=pageCss currentMenu="organizationFlag-userFlag-usersListFlag"]

<div class="page-header">
	<h1>
		用户管理 
		<small> <i class="ace-icon fa fa-angle-double-right"></i> 用户列表</small>
	</h1>
</div>
<form class="bs-example bs-example-form" role="form" action="${ContextPath}/admin/user" method="post">
	<div class="row">
			<div class="col-xs-4" >
				<div class="input-group">
					<span class="input-group-addon">关键字</span> 
					<input class="form-control" id="username" name="username" value="${(username)!}" placeholder="姓名" type="text" autocomplete="off">
					<span class="input-group-btn">
						<button class="btn btn-sm btn-default">
							<span class="glyphicon glyphicon-search"></span>搜索
						</button>
					</span>
				</div>
			</div>
		</div>
</form>
<div class="hr hr-dotted"></div>
	<table class="table table-bordered table-hover">
		<thead>
			<tr>
				<th>编号</th>
				<th>姓名</th>
				<th>账号</th>
				<th>单位</th>
				<th>部门</th>
				<th>职位</th>
				<th>联系电话</th>
				<th>角色</th>
				<th>状态</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			[#list userPage.getList() as user]
			<tr>
				<td>${(user_index+1)!}</td>
				<td>${(user.ufullname)!}</td>
				<td>[#if user.info_userid=1]*****[#else]${(user.uaccount)!}[/#if]</td>
				<td>${(user.bname)!}</td>
				<td>${(user.aname)!}</td>
				<td>${(user.pname)!}</td>
				<td>${(user.uphone)!}</td>
				<td>${(user.remark)!}</td>
				<td>
				[#if user.udeletetime??]
					<b>
					<span class="red">禁用</span>
					[#else]
					<span class="gray">正常</span>
					[/#if]
					</b>
				</td>
				<td>
					[#if (user.uuserid?number)==1]
					[#else]
						<div class="action-buttons">
						<a class="btn btn-minier btn-primary"  href="${ContextPath}/admin/edituser?id=${(user.uuserid)!}" >设置</a>
						[#if user.udeletetime??]
						<a class="btn btn-minier btn-danger"  href="${ContextPath}/admin/onuser?id=${(user.uuserid)!}" >启用</a>
						[#else]
						<a class="btn btn-minier btn-primary"  href="${ContextPath}/admin/offuser?id=${(user.uuserid)!}" >禁用</a>
						</div>
						[/#if]
					[/#if]
				</td>
			</tr>
			[/#list]
			[#if userPage.getList().size()!=10]
			[#assign size=(10-userPage.getList().size())]
				[#list 1..size as t]
					<tr>
						<td>${(userPage.getList().size()+t)!}</td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
					</tr>
				[/#list]
			[/#if]
		</tbody>
	</table>
	[#include "/app/common/inc/_paginate.html" /]
	[@paginate currentPage=userPage.pageNumber totalPage=userPage.totalPage actionUrl="/admin/user/" /]
[/@mainlayout]